package com.meeting.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meeting.entity.EquipmentType;

import com.meeting.mapper.EquipmentTypeMapper;
import com.meeting.service.EquipmentTypeService;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Service;

import java.util.List;
@Service
@Slf4j
public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, EquipmentType>
        implements EquipmentTypeService {

    @Override
    public List<EquipmentType> getAllEquipmentTypes() {
        log.info("获取所有设备类型");
        return this.list();
    }

    // 🔧 新增：实现接口中定义的方法
    @Override
    public EquipmentType getEquipmentTypeById(Integer id) {
        log.info("根据ID获取设备类型：{}", id);
        return this.getById(id);
    }

    @Override
    public void addEquipmentType(EquipmentType equipmentType) {
        log.info("添加设备类型：{}", equipmentType);
        this.save(equipmentType);
    }

    @Override
    public void updateEquipmentType(EquipmentType equipmentType) {
        log.info("更新设备类型：{}", equipmentType);
        this.updateById(equipmentType);
    }

    @Override
    public void deleteEquipmentType(Integer id) {
        log.info("删除设备类型：{}", id);
        this.removeById(id);
    }
}
